package com.ymt.bpm.service.engine.task.impl;

import com.alibaba.fastjson.JSONObject;
import com.ymt.bpm.appboot.env.Caches;
import com.ymt.bpm.dao.MDao;
import com.ymt.bpm.dao.Mapper;
import com.ymt.bpm.service.engine.task.FmdIntegrationService;
import com.ymt.bpm.service.mobile.MFmdService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Johnny on 2017/4/22.
 */
@Service
public class FmdIntegrationServiceImpl implements FmdIntegrationService {

    private Logger log = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private Environment env;

    @Autowired
    private MFmdService mfmds;

    @Override
    public JSONObject getModelsOfForm(String tenantId, String formid, String versionid) {
        JSONObject formdata = mfmds.getFormData(tenantId, formid, versionid);
        //TODO summary data - or set summary in bpd
        JSONObject models = formdata.getJSONObject("models");
        return models;
    }

}
